import request from '@/utils/request'
var group_name = 'comment'
export default {
  save(obj) { // 添加
    return request({
      url: `/${group_name}/save`,
      method: 'post',
      data: obj
    })
  },
  getListByBlogId(id) {
    return request({
      url: `/${group_name}/getListByBlogId/${id}`,
      method: 'get'
    })
  },
  getByPage(page) { // 分页查询
    return request({
      url: `/${group_name}/getByPage`,
      method: 'post',
      data: page
    })
  },
  getById(id) { // 根据id查询
    return request({
      url: `/${group_name}/get/${id}`,
      method: 'get'
    })
  },
  deleteById(id) { // 删除
    return request({
      url: `/${group_name}/delete/${id}`,
      method: 'delete'
    })
  },
  good(obj) { // 点赞
    return request({
      url: `/${group_name}/good`,
      method: 'post',
      data: obj
    })
  },
  getGood(id) { // 是否点赞
    return request({
      url: `/${group_name}/hasGood/${id}`,
      method: 'get',
      data: id
    })
  }
}
